//
// Created by v on 19-5-29.
//

#ifndef OPENGLFUNC_CAMERACAPTURE_H
#define OPENGLFUNC_CAMERACAPTURE_H

#include "opencv2/opencv.hpp"
#include "QtGui/qimage.h"

class CameraCapture {
public:
    int open(int index = 0);
    int close();

    bool opened();

    bool getFrame(cv::Mat &img);
    bool getImage(QImage &img);

    bool Mat2QImage(const cv::Mat &mat, QImage &imgout);

private:
    cv::VideoCapture  *m_cap;
};


#endif //OPENGLFUNC_CAMERACAPTURE_H
